// MultiStepper
// -*- mode: C++ -*-
//
// Control both Stepper motors at the same time with different speeds
// and accelerations. 
// Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library)
// And AccelStepper with AFMotor support (https://github.com/adafruit/AccelStepper)
// Public domain!

long time;
long loopCounter;

void setup()
{  

  pinMode(2, INPUT);
  pinMode(3, OUTPUT);

 
  Serial.begin(9600);
  time = millis();
  loopCounter = 0;
}

int i = 0;
int inChar;
String inString = "";

void sendState()
{

  char s[255] = "time:";
  char s1[11] = "";
  ltoa(millis(), s1, 10);
  strcat( s, s1 );
  strcat(s,";cycle:");
  ltoa(loopCounter, s1, 10);
  strcat( s, s1 );
  strcat (s,";");
  Serial.flush();
  Serial.println( s ); 
}


void loop()
{
  loopCounter++;
  if (millis() - time > 1000)
   {
     sendState();
     time = millis();
   }
}




